package com.banyuan.domain;

import java.util.Objects;

public class PageInfo {
    private Integer total; // 总条数
    private Integer curr; //当前第几页
    private Integer size;// 每页多少条
    private Integer pages; //总共多少页


    public PageInfo() {
    }

    public PageInfo(Integer total, Integer curr, Integer size, Integer pages) {
        this.total = total;
        this.curr = curr;
        this.size = size;
        this.pages = pages;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getCurr() {
        return curr;
    }

    public void setCurr(Integer curr) {
        this.curr = curr;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    @Override
    public String toString() {
        return "PageInfo{" +
                "total=" + total +
                ", curr=" + curr +
                ", size=" + size +
                ", pages=" + pages +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PageInfo pageInfo = (PageInfo) o;
        return Objects.equals(total, pageInfo.total) && Objects.equals(curr, pageInfo.curr) && Objects.equals(size, pageInfo.size) && Objects.equals(pages, pageInfo.pages);
    }

    @Override
    public int hashCode() {
        return Objects.hash(total, curr, size, pages);
    }
}
